1. Field of the Invention
The invention relates to computer graphics rendering and display. More particularly, the invention relates to a method and apparatus for improving a bottleneck in the data communication between a raster engine and a depth buffer in a computer graphics system.
2. Description of the Related Art
Three-dimensional (3D) objects are commonly represented in computer graphics applications as an approximation of their surface via a sufficiently large number of polygons, such as triangles. Typically, a 3D computer graphics system has two main functions, that is, geometric processing and rasterizing. Geometric calculations such as transformation, light modeling, clipping and perspective projection are executed in a geometry engine. In converting from a 3D representation of an image to a two-dimensional (2D) representation, many calculations of color values and hidden surface removal are executed in a raster engine.
One of the most widely used hidden surface removal algorithms is the depth-buffer routine. This routine determines which points on which polygons are closest to the viewer for every pixel on the screen. It requires a frame buffer in which color values are stored, and a Z-buffer, with the same number of entries, in which a Z-value (depth value, e.g. a measure of the distance to the viewer) is stored for each pixel of a scene. The frame buffer is initialized to the background color. A Z-buffer 100 is initialized to zero representing the Z-value at the back clipping plane, as illustrated in FIG. 1A. The largest value that can be stored in the Z-buffer 100 represents the Z-value of the front clipping plane. During the scan conversion process, if the polygon point being scan-converted at a given pixel on the screen is no farther from the viewer than the point whose color and depth are currently in the frame buffer (not shown) and the Z-buffer 100, respectively, then the color and depth of the new points replace the old values, as illustrated in FIG. 1B.
In 3D graphics processing for hidden surface removal, the raster engine requires at least one read access to the Z-buffer 100 and one comparison of the old and new Z-values for each pixel. Depending on the comparison, the raster engine performs write access to the Z-buffer 100 whereby it can update the Z-buffer 100 with the new Z-values. The advantage of the above-described process is that polygons which belong to any object can be rendered in arbitrary order independent of their depth. However, the use of the depth-buffer routine requires a large amount of data to be communicated between a raster engine and a Z-buffer or depth-buffer, and the performance of a computer graphics system is degraded by a bottleneck phenomenon in the data communication. There exists a bandwidth problem during Z-buffer access.
Accordingly, what is needed is a reduced amount of depth information to be transferred during depth-buffer access. The present invention addresses such a need.